package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.DeviceDataPageReqDto;
import com.zzyl.service.DeviceDataService;
import com.zzyl.vo.DeviceDataVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ Description: 管理端 - 设备数据相关接口
 * @ BelongsProject: zzyl-cp
 * @ Author: G攀
 * @ CreateTime: 2024-09-12  11:53
 * @ Version: 1.0
 */
@RestController
@RequestMapping("/device-data")
@Api(tags = "管理端 - 设备数据相关接口")
@Slf4j
public class DeviceDataController {

    @Autowired
    private DeviceDataService deviceDataService;

    @GetMapping("/get-page")
    @ApiOperation("获取物模型数据分页结果")
    public ResponseResult<PageResponse<DeviceDataVo>> getDeviceDataPage(DeviceDataPageReqDto pageReqDto) {
        log.info("获取物模型数据分页结果：{}", pageReqDto);
        PageResponse<DeviceDataVo> dataVoPageResponse = deviceDataService.getDeviceDataPage(pageReqDto);
        return ResponseResult.success(dataVoPageResponse);
    }
}
